<template>
  <div>
    <ul>
      <li v-for="(i, item) in arr" :key="item">
        <input
          type="text"
          v-model="i.title"
          @keydown.enter="shuang(i, item)"
          v-if="i.show"
        />
        <span v-if="i.show == false" @dblclick="shuang2(i, item)">出现</span>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data() {
    return {
      arr: [
        { title: "zs", show: true },
        { title: "ls", show: true },
        { title: "lw", show: true },
      ],
    };
  },
  methods: {
    shuang(i) {
      console.log(this.arr);
      i.show = false;
    },
    shuang2(i) {
      i.show = true;
    },
  },
};
</script>
